package theOrbalEra.client.handler;

import theOrbalEra.client.gui.GuiOrbalFactory;
import theOrbalEra.common.block.ContainerOrballFactory;
import theOrbalEra.common.block.TileEntityOrballFactory;
import theOrbalEra.common.util.idList.OrbalGuiID;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;

public class GuiHandler implements IGuiHandler {
	@Override
	public Object getClientGuiElement(int ID, EntityPlayer player, World world,
			int x, int y, int z) {
		TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
		switch (ID) {

		case OrbalGuiID.Orbal_FAC:
			if (tileEntity instanceof TileEntityOrballFactory) {
				return new GuiOrbalFactory(player.inventory,
						(TileEntityOrballFactory) tileEntity);
			}
		
		
		default:
			return null;
		}
	}

	@Override
	public Object getServerGuiElement(int ID, EntityPlayer player, World world,
			int x, int y, int z) {
		TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
		switch (ID) {
		case OrbalGuiID.Orbal_FAC:
			if (tileEntity instanceof TileEntityOrballFactory) {
				return new ContainerOrballFactory(player.inventory,
						(TileEntityOrballFactory) tileEntity);
			}
		
			
		default:
			return null;
		}
	}

}
